<%-- 
    Document   : testfileforchart
    Created on : 08.okt.2012, 17:20:51
    Author     : 500209
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script>
            function getdata(chart) {
                    var tmp="";
                    var receivedData="";

                    $.ajax({
                        url : 'http://localhost:8080/main/liveUpdate',
                        dataType : 'json',
                        error : function() {
                            alert("error occured!!!");
                        },
                        success : function(data) {
                            var chartData=[];
                            $.each(data.jsonArray, function(index)
                            {
                                $.each(data.jsonArray[index], 
                                function(key,value) {
                                    var point = [];
                                    point.push(key);
                                    point.push(value);
                                    chartData.push(point);                          
                                });
                            });
                            chart.series[0].setData(chartData);
                        }
                    }
            );
        </script>
        <title>JSP Page</title>
    </head>
    <body onload="getdata() ;">
         <div id="container"></div>
    </body>
</html>
